package com.starter.zoe;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author Zoe.Zhang
 * @date 2021/11/30
 * @description
 */
@Configuration
@EnableConfigurationProperties(ZoeProperties.class)
@ConditionalOnClass(ZoeService.class)
public class ZoeAutoConfiguration {
    private static final Logger logger = LoggerFactory.getLogger(ZoeAutoConfiguration.class);
    @Autowired
    ZoeProperties zoeProperties;

    @Bean
    ZoeService zoeService() {
        logger.info("zoeService加载...............");
        ZoeService zoeService = new ZoeService(zoeProperties);
        return zoeService;
    }
}
